package com.enthal.basicpers

import android.app.Notification
import android.os.Build
import android.service.notification.StatusBarNotification

class NoticeInfo(sbn: StatusBarNotification) {
    var pkgname:String = sbn.packageName
    var id:Int = sbn.id
  //  var key:String = sbn.key
    var time:Long = sbn.postTime
    var tag:String? = sbn.tag
    var clearable:Boolean = sbn.isClearable
    var ongoing:Boolean = sbn.isOngoing
    var title: String? = sbn.notification.extras.getString(Notification.EXTRA_TITLE)
    var content: String? = sbn.notification.extras.getString(Notification.EXTRA_TEXT)
    var subtext: String? = sbn.notification.extras.getString(Notification.EXTRA_SUB_TEXT)

    fun empty(): Boolean {
        return null == title || title!!.isEmpty()
    }

    override fun toString(): String {
        return "NoticeInfo(pkgname='$pkgname', id=$id, time=$time, tag=$tag, clearable=$clearable, ongoing=$ongoing, title=$title, content=$content, subtext=$subtext)"
    }

}